package com.golden.procedure.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class Tools {

	public static String random () {
		 int flag = new Random().nextInt(999999);  
         if (flag < 100000)  
         {  
             flag += 100000;  
         }  
         return "" + flag;
	}
	
	public static Date getDatetime(Date date, Date time) {
		
		SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
		SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm:ss");
		SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String dtString = sdf1.format(date) + " " + sdf2.format(time);
		try {
			return sdf3.parse(dtString);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
